Add configure option to set docdir and enable efence builds.
authorrobertl <robertl>
Mon, 25 Sep 2006 01:08:25 +0000 (01:08 +0000)
committerrobertl <robertl>
Mon, 25 Sep 2006 01:08:25 +0000 (01:08 +0000)
From Fenoy GĂ©rald.

Makefile.in
configure
configure.in
tools/mkcapabilities.in
xmldoc/chapters/build.xml
xmldoc/makedoc.in

index f4dafadc838341fabf495615d58a0171358b207a..2c674fb18e7b97a57ac3ec1f627b0612eb969062 100644 (file)
@@ -36,7 +36,7 @@ OUTPUT_SWITCH=-o #
 GBCFLAGS=$(EXTRA_CFLAGS) $(DEBUGGING) -I. -I@srcdir@/coldsync \
        $(OPTIMIZATION) @CFLAGS@
 LDFLAGS=$(EXTRA_LDFLAGS) @LDFLAGS@
-INSTALL_TARGETDIR=/usr/local/
+DESTDIR=/usr/local/
 
 # OTHER_ROOT=/opt/local        # For DarwinPorts on OSX
 # OTHER_ROOT=/sw               # Uncomment For Fink on OS X.
@@ -93,14 +93,17 @@ OBJS = main.o globals.o $(LIBOBJS) @FILEINFO@
 
 
 # Directory of local web doc.  Traditionally a sibling to the GPSBabel tree.
-WEB=../babelweb/
+WEB=@DOCDIR@
 
 
 all: gpsbabel$(EXEEXT)
 
-gpsbabel$(EXEEXT): $(OBJS)
+gpsbabel$(EXEEXT): $(OBJS) @GPSBABEL_DEBUG@
        $(CC)  $(CFLAGS) $(LDFLAGS) $(OBJS) @LIBS@ @EXPAT_LIB@ @USB_LIBS@ $(OUTPUT_SWITCH)$@
 
+gpsbabel-debug: $(OBJS)
+       $(CC)  $(CFLAGS) $(LDFLAGS) $(OBJS) @LIBS@ @EFENCE_LIB@ @EXPAT_LIB@ @USB_LIBS@ $(OUTPUT_SWITCH)$@
+
 Makefile: Makefile.in config.status
        CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status 
 
@@ -132,8 +135,11 @@ torture:
 #
 # This will only work on UNIX-like substances.
 #
-install:
-       install gpsbabel  $(INSTALL_TARGETDIR)/bin
+install: @INSTALL_DEBUG@
+       install gpsbabel  $(DESTDIR)/bin
+
+install-debug:
+       install gpsbabel-debug  $(DESTDIR)/bin
 
 # Nerdy release stuff that needs to work only on Linux.
 
@@ -157,6 +163,7 @@ $(WEB)/htmldoc-$(DOCVERSION)/readme.html: FORCE
         --stringparam root.filename "readme" \
         xmldoc/babelmain.xsl \
         xmldoc/readme.xml
+       chmod 755 tools/mkcapabilities
        tools/mkcapabilities
 
 gpsbabel.html: FORCE
index 5b2798e1e6eada2cdfece34a719fc528be9f23c9..be7c1e896885e179de45ccd6245d7386d8f5cab3 100755 (executable)
--- a/configure
+++ b/configure
@@ -273,7 +273,7 @@ PACKAGE_VERSION='1.3.1'
 PACKAGE_STRING='GPSBabel 1.3.1'
 PACKAGE_BUGREPORT='BUG-REPORT-ADDRESS'
 
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS PACKAGE_RELEASE GBMAJOR GBMINOR GBMICRO build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA SET_MAKE  FILEINFO RC LIBUSBCONFIG USB_LIBS USB_CFLAGS OSJEEPS GBSER ZLIB EXPAT_LIB LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS PACKAGE_RELEASE GBMAJOR GBMINOR GBMICRO build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA SET_MAKE  FILEINFO RC LIBUSBCONFIG USB_LIBS USB_CFLAGS OSJEEPS GBSER ZLIB EXPAT_LIB EFENCE_LIB GPSBABEL_DEBUG INSTALL_DEBUG DOCDIR LIBOBJS LTLIBOBJS'
 ac_subst_files=''
 
 # Initialize some variables set by options.
@@ -811,6 +811,7 @@ Optional Features:
   --enable-pdb=(yes)|no
   --enable-csv=(yes)|no
   --enable-filters=(yes)|no
+  --enable-efence=yes|(no)
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
@@ -819,6 +820,7 @@ Optional Packages:
   --with-zlib=(included)|system|no
   --with-expathdr=DIR   Use this to specify the location of expat.h
   --with-libexpat=DIR   Use this to specify expat library .
+  --with-doc=DIR        Path where the documentation will be stored.
 
 Some influential environment variables:
   CC          C compiler command
@@ -3285,11 +3287,39 @@ cat >>confdefs.h <<\_ACEOF
 _ACEOF
 
 
-#  [EXPAT_LIB="$LDFLAGS -lexpat"]
 
 fi
 
 
+echo "$as_me:$LINENO: checking for efence" >&5
+echo $ECHO_N "checking for efence... $ECHO_C" >&6
+# Check whether --enable-efence or --disable-efence was given.
+if test "${enable_efence+set}" = set; then
+  enableval="$enable_efence"
+   if test "$enable_efence" != "no" ; then
+       EFENCE_LIB=-lefence
+       GPSBABEL_DEBUG=gpsbabel-debug
+       INSTALL_DEBUG=install-debug
+    fi
+fi;
+
+
+
+echo "$as_me:$LINENO: result: $EFENCE_LIB" >&5
+echo "${ECHO_T}$EFENCE_LIB" >&6
+
+echo "$as_me:$LINENO: checking for docdir" >&5
+echo $ECHO_N "checking for docdir... $ECHO_C" >&6
+
+# Check whether --with-doc or --without-doc was given.
+if test "${with_doc+set}" = set; then
+  withval="$with_doc"
+  DOCDIR="$withval"
+else
+  DOCDIR="../babelweb/"
+fi;
+
+
 # Checks for header files.
 # AC_HEADER_STDC
 
@@ -3418,7 +3448,7 @@ fi
 done
 
 
-                                                            ac_config_files="$ac_config_files Makefile win32/gpsbabel.rc coldsync/Makefile jeeps/Makefile shapelib/Makefile zlib/empty"
+                                                                                ac_config_files="$ac_config_files Makefile xmldoc/makedoc tools/mkcapabilities win32/gpsbabel.rc coldsync/Makefile jeeps/Makefile shapelib/Makefile zlib/empty"
 
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
@@ -3946,6 +3976,8 @@ do
   case "$ac_config_target" in
   # Handling of arguments.
   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+  "xmldoc/makedoc" ) CONFIG_FILES="$CONFIG_FILES xmldoc/makedoc" ;;
+  "tools/mkcapabilities" ) CONFIG_FILES="$CONFIG_FILES tools/mkcapabilities" ;;
   "win32/gpsbabel.rc" ) CONFIG_FILES="$CONFIG_FILES win32/gpsbabel.rc" ;;
   "coldsync/Makefile" ) CONFIG_FILES="$CONFIG_FILES coldsync/Makefile" ;;
   "jeeps/Makefile" ) CONFIG_FILES="$CONFIG_FILES jeeps/Makefile" ;;
@@ -4072,6 +4104,10 @@ s,@OSJEEPS@,$OSJEEPS,;t t
 s,@GBSER@,$GBSER,;t t
 s,@ZLIB@,$ZLIB,;t t
 s,@EXPAT_LIB@,$EXPAT_LIB,;t t
+s,@EFENCE_LIB@,$EFENCE_LIB,;t t
+s,@GPSBABEL_DEBUG@,$GPSBABEL_DEBUG,;t t
+s,@INSTALL_DEBUG@,$INSTALL_DEBUG,;t t
+s,@DOCDIR@,$DOCDIR,;t t
 s,@LIBOBJS@,$LIBOBJS,;t t
 s,@LTLIBOBJS@,$LTLIBOBJS,;t t
 CEOF
index 3e58529c5f986a02af5745f972765d1e9af3e841..30125b2a8938b561066d54433673ea99e83098ed 100644 (file)
@@ -228,9 +228,26 @@ AC_MSG_RESULT($EXPAT_LIB)
 AC_CHECK_LIB([expat], [XML_ParserCreate], 
   AC_DEFINE(HAVE_LIBEXPAT, 1, [Defined if you have libexpat])
   AC_SUBST(EXPAT_LIB)
-#  [EXPAT_LIB="$LDFLAGS -lexpat"]
 )
 
+AC_MSG_CHECKING(for efence)
+AC_ARG_ENABLE(efence,
+  [  --enable-efence=[yes|(no)]],
+  [ if test "$enable_efence" != "no" ; then
+       EFENCE_LIB=-lefence
+       GPSBABEL_DEBUG=gpsbabel-debug
+       INSTALL_DEBUG=install-debug
+    fi])
+AC_SUBST(EFENCE_LIB)
+AC_SUBST(GPSBABEL_DEBUG)
+AC_SUBST(INSTALL_DEBUG)
+AC_MSG_RESULT($EFENCE_LIB)
+
+AC_MSG_CHECKING(for docdir)
+AC_ARG_WITH(doc,[  --with-doc=DIR        Path where the documentation will be stored.],
+             DOCDIR="$withval", DOCDIR="../babelweb/")
+AC_SUBST(DOCDIR)
+
 # Checks for header files.
 # AC_HEADER_STDC
 
@@ -257,5 +274,5 @@ AC_CHECK_LIB([expat], [XML_ParserCreate],
 # AC_CHECK_FUNCS([atexit floor localtime_r memmove memset pow select sqrt strchr strcspn strdup strerror strncasecmp strrchr strspn strstr strtol strtoul])
 AC_CHECK_FUNCS([nanosleep sleep])
 
-AC_CONFIG_FILES([Makefile win32/gpsbabel.rc coldsync/Makefile jeeps/Makefile shapelib/Makefile zlib/empty])
+AC_CONFIG_FILES([Makefile xmldoc/makedoc tools/mkcapabilities win32/gpsbabel.rc coldsync/Makefile jeeps/Makefile shapelib/Makefile zlib/empty])
 AC_OUTPUT
index 22532616504f7976ac5cdae06af368f1bf96e181..172b12adf58b9c1c06509d5a7f7a504d43d6505c 100755 (executable)
@@ -28,4 +28,4 @@ function getcap(type, cap, sname, lname) {
 }
 
 getcap($1, $2, $3, $5)
-' > ../babelweb/capabilities.inc > ../babelweb/capabilities.inc
+' > @DOCDIR@capabilities.inc > @DOCDIR@capabilities.inc
index 1bfe7dc281d21727d96bb8d9719f27b524dd67fb..c0aee29312246b31524664f4bf4ab1c1d6fc778a 100644 (file)
@@ -43,6 +43,12 @@ is recommended for OS/X and Linux if you want to use a USB Garmin.
 <para>
   <option>--disable-filters</option> Excludes all filter support.
 </para>
+<para>
+  <option>--enable-efence</option> Activate debugging mode for gpsbabel-debug.
+</para>
+<para>
+  <option>--with-doc=dir</option> Specify that the doc should be created and installed in <option>dir</option>.
+</para>
 <para>
   <option>--without-libusb</option> Disables use of libusb, even it's it's available.
 </para>
index bf6d1728f21365448ea3395cc458f132966151f0..7653f534227c41b33ec0548ec5583230a2335004 100755 (executable)
@@ -64,6 +64,7 @@ sub includef {
 
 
 
+@dir=`mkdir -p @DOCDIR@`;
 $dir = $0;
 $dir =~ s:/.*$::;